package com.woniuxy.user.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.core.annotation.Permission;
import com.woniuxy.core.util.Result;
import com.woniuxy.user.entity.UserLogin;
import com.woniuxy.user.service.UserLoginService;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ...
 * @since 2024年05月22日
 */
@RestController
@RequestMapping("/userLogin")
@Api(tags = "用户登录日志")
public class UserLoginController {
    @Resource
    private UserLoginService userLoginService;
    /**
     * 分页查询用户登录日志
     * @return
     */
    @GetMapping("/loadAllUserLogin")
    @ApiOperation("分页查询用户登录日志")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageNum",value = "当前页数"),
            @ApiImplicitParam(name = "pageSize",value = "每页几条")
    })
    @ApiResponses({
           @ApiResponse(code = 200,message = "OK",response = UserLogin.class)
    })
    @Permission(roles = {"超级管理员","管理员"})
    public Result loadAllUserLogin(Integer pageNum,Integer pageSize){
        Page<UserLogin> pages = userLoginService.loadAllUserLogin(pageNum,pageSize);
        return Result.success("查询成功",pages);
    }
}

